//
//  ContentTableViewCell.m
//  projectA_kuaiZuiManHua
//
//  Created by mk on 15-3-21.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "ContentTableViewCell.h"
#import "UIButton+InitButton.h"

@implementation ContentTableViewCell
- (void)dealloc
{
    [_myImageView release];
    [_titleLabel release];
    [_updataLabel release];
    [_untilLabel release];
    [_tapView release];

    [super dealloc];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myImageView = [[UIImageView alloc]init];
        self.myImageView.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.myImageView];
        [_myImageView release];
        
        self.titleLabel = [[UILabel alloc]init];
        self.titleLabel.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.updataLabel = [[UILabel alloc]init];
        self.updataLabel.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.updataLabel];
        [_updataLabel release];
        
        self.untilLabel = [[UILabel alloc]init];
        self.untilLabel.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.untilLabel];
        [_untilLabel release];

        self.tapView = [[UIImageView alloc]init];
        self.tapView.image = [UIImage imageNamed:@"iconfont-jihuo.png"];
        self.tapView.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(action:)];
        tap.numberOfTapsRequired = 1;
        tap.numberOfTouchesRequired = 1;
        [self.tapView addGestureRecognizer:tap];
        [tap release];
        
        [self.contentView addSubview:self.tapView];
        [_tapView release];

    }
    
    return self;

}

-(void)layoutSubviews
{
    [super layoutSubviews];
//    CGFloat width =  self.contentView.frame.size.width;
//    CGFloat height = self.contentView.frame.size.height;
    
    self.myImageView.frame = CGRectMake(4, 4, 100, 112);
    self.titleLabel.frame = CGRectMake(108, 8, 100, 25);
    self.updataLabel.frame = CGRectMake(108, 38, 100, 25);
    self.untilLabel.frame = CGRectMake(108, 68, 100, 25);
    self.tapView.frame = CGRectMake(300, 40, 30, 30);


}
- (void)action:(UITapGestureRecognizer *)tap
{

    
    NSLog(@"点点点");


}

@end
